﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ICM_Master_resource_Type.aspx.cs" Inherits="KPIS.GERP.GIMS.APP.APP_UI.Delete_Form.ICM_Master_resource_Type" %>
<%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <meta http-equiv="X-UA-Compatible" content="IE=8" />
    <title></title>
    <LINK REL="StyleSheet" HREF="../../Styles/StyleSheet.css" TYPE="text/css">  
</head>
<body>
    <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true" >
        </asp:ScriptManager>
        <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
            <script type="text/javascript" src="../../Scripts/Common.js"></script>
            <script type="text/javascript">
                function RowDbClick(sender, eventArgs) {
                    var hiddenElement = document.getElementById("<%= hdSeq.ClientID %>");
                    hiddenElement.value = eventArgs.getDataKeyValue("Seq");
                    $find("<%= RadManager1.ClientID %>").ajaxRequest(hiddenElement.value);
                }
                
                function SeqClick(seq) {
                    var hiddenElement = document.getElementById("<%= hdSeq.ClientID %>");
                    hiddenElement.value = seq;
                    $find("<%= RadManager1.ClientID %>").ajaxRequest(seq);
                }
            </script>
        </telerik:RadCodeBlock>
        <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" BackgroundPosition="None" Skin="Outlook">
        </telerik:RadAjaxLoadingPanel>
        <telerik:RadAjaxManager runat="server" ID="RadManager1" OnAjaxRequest="RadManager1_AjaxRequest">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="panelData">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="panelCommand" />
                        <telerik:AjaxUpdatedControl ControlID="panelData" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="panelCommand">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="panelCommand" />
                        <telerik:AjaxUpdatedControl ControlID="panelData" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>
    
        <asp:HiddenField ID="hdSeq" runat="server" Value="" />
        
        <table style="width: 624px; height: 100%" cellpadding="0" cellspacing="0">
            <tr valign="top">
                <td valign="top">
                    <asp:Panel ID="panelCommand" runat="server">
                        <div class="bigModuleRightTree">
                            <div class="bigModuleBottomRightTree">
                                <table>
                                    <tr class="command-list">
                                        <td class="command-item" style="border: none">
                                            <asp:LinkButton ID="ShowGrid" runat="server" CssClass="LinkButton" CausesValidation="false" OnClick="ShowGrid_Click">
                                                <img style="border:0px;vertical-align:middle;" alt="" src="../Image/Grid/table.gif" />&nbsp;&nbsp;แสดงข้อมูลที่ลบทั้งหมด
                                            </asp:LinkButton>                        
                                        </td>
                                        <td class="command-item" style="border: none">
                                            <asp:LinkButton ID="Restore" runat="server" CssClass="LinkButton" CausesValidation="false" OnClientClick="javascript:return confirm('ยืนยันการกู้คืนข้อมูลที่เลือก')" OnClick="Restore_Click">
                                                <img style="border:0px;vertical-align:middle;" alt="" src="../Image/Grid/Restore.gif" />&nbsp;&nbsp;กู้คืนข้อมูล
                                            </asp:LinkButton>                        
                                        </td>
                                        <td class="command-item">
                                            <asp:LinkButton ID="DeleteFromDB" runat="server" CssClass="LinkButton" CausesValidation="false" OnClientClick="javascript:return confirm('ยืนยันการลบข้อมูลที่เลือกออกจากฐานข้อมูล')" OnClick="DeleteFromDB_Click">
                                                <img style="border:0px;vertical-align:middle;" alt="" src="../Image/Grid/Delete.gif" />&nbsp;&nbsp;ลบออกจากฐานข้อมูล
                                            </asp:LinkButton>
                                        </td>
                                    </tr>
                                </table>
                            </div>
                        </div>        
                    </asp:Panel>
                </td>
            </tr>
            <tr>
                <td>
                    <asp:Panel ID="panelData" runat="server">
                        <div class="bigModuleRightTree">
                            <div class="bigModuleBottomRightTree">
                                <asp:Panel runat="server" ID="panelList" Height="422px" ScrollBars="Auto">
                                    <asp:Panel ID="panelHeaderList" runat="server">
                                        <div class="header-grid">
                                            <asp:Label ID="lblHeaderList" runat="server" Text="ประเภทพัสดุ"></asp:Label>
                                        </div>
                                    </asp:Panel>
                                    <ul class="formList" id="Ul1">      
                                        <li>
                                            <table>
                                                <tr>
                                                    <td width = "150px">
                                                        รหัส :
                                                    </td>
                                                    <td>
                                                        <asp:Label runat="server" ID="lbCode" AssociatedControlID="txtCode"></asp:Label>
                                                        <asp:TextBox ID="txtCode" runat="server" Visible="false" Width="150px"></asp:TextBox>
                                                        <label id="Label1" runat="server"><font color="red">*</font></label>
                                                        <asp:RequiredFieldValidator ID="ValtxtCode" runat="server" 
                                                        ControlToValidate="txtCode" SetFocusOnError="True"></asp:RequiredFieldValidator>
                                                    </td>
                                                </tr>
                                            </table>
                                        </li>
                                        <li>
                                            <table>
                                                <tr>
                                                    <td width = "150px">
                                                        ประเภทพัสดุ :
                                                    </td>
                                                    <td>
                                                        <asp:Label runat="server" ID="lblName" AssociatedControlID="txtName"></asp:Label>
                                                        <asp:TextBox ID="txtName" runat="server" Visible="false" Width="300px"></asp:TextBox>
                                                        <label id="Label2" runat="server"><font color="red">*</font></label>
                                                        <asp:RequiredFieldValidator ID="ValtxtName" runat="server"
                                                        ControlToValidate="txtName" SetFocusOnError="True"></asp:RequiredFieldValidator>
                                                    </td>
                                                </tr>
                                            </table>
                                        </li>         
                                        <li>
                                            <table>
                                                <tr>
                                                    <td width = "150px" valign="top">
                                                        รายละเอียด :
                                                    </td>
                                                    <td>
                                                        <asp:Label runat="server" ID="lblDescr" AssociatedControlID="txtDescr"></asp:Label>
                                                        <asp:TextBox ID="txtDescr" runat="server" Visible="false" TextMode="MultiLine" Height="100" Width="300px" Font-Names="Microsoft Sans Serif"></asp:TextBox>
                                                    </td>
                                                </tr>
                                            </table>
                                        </li>
                                        <li>
                                            <table>
                                                <tr>
                                                    <td width = "150px" valign="top">
                                                        คิดค่าเสื่อมราคา :
                                                    </td>
                                                    <td>
                                                        <asp:Label runat="server" ID="lblStatus" AssociatedControlID="cmbStatus" ></asp:Label>
                                                        <telerik:RadComboBox ID="cmbStatus" Runat="server" EmptyMessage="-เลือกวิธีการ-" Skin="Vista">
                                                            <Items>
                                                                <telerik:RadComboBoxItem runat="server" Text="คิดค่าเสื่อม" Value="Y" />
                                                                <telerik:RadComboBoxItem runat="server" Text="ไม่คิดค่าเสื่อม" Value="N" />
                                                            </Items>
                                                        </telerik:RadComboBox>
                                                    </td>
                                                </tr>
                                            </table>
                                        </li>
                                        <li>
                                            <table>
                                                <tr>
                                                    <td width = "150px" valign="top">
                                                        ลบโดย :
                                                    </td>
                                                    <td>
                                                        <asp:Label runat="server" ID="lblUpdatedBy" AssociatedControlID="txtUpdatedBy" ></asp:Label>
                                                        <asp:TextBox ID="txtUpdatedBy" runat="server" Visible="false" Width="300px"></asp:TextBox>
                                                    </td>
                                                </tr>
                                            </table>
                                        </li>
                                        <li>
                                            <table>
                                                <tr>
                                                    <td width = "150px" valign="top">
                                                        ลบเมื่อ :
                                                    </td>
                                                    <td>
                                                        <asp:Label runat="server" ID="lblUpdatedWhen" AssociatedControlID="txtUpdatedWhen" ></asp:Label>
                                                        <asp:TextBox ID="txtUpdatedWhen" runat="server" Visible="false" Width="300px"></asp:TextBox>
                                                    </td>
                                                </tr>
                                            </table>
                                        </li>
                                        <li class="lastListItem">
                                        </li>
                                    </ul>
                                </asp:Panel>
                                <asp:Panel ID="panelGrid" runat="server" Height="422px" ScrollBars="Auto" Visible="true">
                                    <asp:Panel ID="panelHeaderGrid" runat="server">
                                        <div class="header-grid">
                                            <asp:Label ID="lblHeaderGrid" runat="server" Text="ประเภทพัสดุ"></asp:Label>
                                        </div>
                                    </asp:Panel>
                                    <div align="center">
                                        <telerik:RadGrid ID="Grid" runat="server" AllowFilteringByColumn="true"
                                        AllowMultiRowSelection="True" AllowPaging="True" AllowSorting="True"
                                        AutoGenerateColumns="False" EnableAJAX="True"  PageSize="8"
                                        GridLines="None" ShowStatusBar="false" Skin="Telerik" Width="95%"
                                        OnItemCommand="Grid_ItemCommand">
                                            <MasterTableView AllowMultiColumnSorting="true" DataKeyNames="Seq" ClientDataKeyNames="Seq" Width="100%">
                                                <PagerStyle Mode="NextPrevNumericAndAdvanced" />
                                                <Columns>
                                                    <telerik:GridClientSelectColumn UniqueName="ClientSelectColumn">
                                                        <HeaderStyle Width="20px" HorizontalAlign="Center" />
                                                        <ItemStyle HorizontalAlign="Center" />
                                                    </telerik:GridClientSelectColumn>
                                                    <telerik:GridBoundColumn DataField="Code" 
                                                        AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false"
                                                        FilterControlWidth="100%"
                                                        HeaderStyle-HorizontalAlign="Center" HeaderText="รหัส" 
                                                        UniqueName="Code">
                                                        <HeaderStyle HorizontalAlign="Center" Width="50px" />
                                                    </telerik:GridBoundColumn>
                                                    <telerik:GridTemplateColumn DataField="Name"  HeaderText="ประเภทพัสดุ"
                                                        AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false"
                                                        FilterControlWidth="100%" UniqueName="Name" SortExpression="Name">
                                                        <HeaderStyle HorizontalAlign="Center" Width="80px" />
                                                        <ItemStyle HorizontalAlign="Left" />
                                                        <ItemTemplate>
                                                            <asp:HyperLink runat="server" NavigateUrl="#" onclick='<%# Eval("Seq","return SeqClick( {0} );") %>' Text='<%# Eval("Name") %>'></asp:HyperLink>
                                                        </ItemTemplate>
                                                    </telerik:GridTemplateColumn>
                                                    <telerik:GridBoundColumn DataField="Descr" 
                                                        AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false"
                                                        FilterControlWidth="100%"
                                                        HeaderStyle-HorizontalAlign="Center" HeaderText="รายละเอียด" 
                                                        UniqueName="Descr">
                                                        <HeaderStyle HorizontalAlign="Center" />
                                                        <ItemStyle HorizontalAlign="Left" />
                                                    </telerik:GridBoundColumn>
                                                    <telerik:GridTemplateColumn HeaderText="คิดค่าเสื่อม" ShowFilterIcon="false" AllowFiltering="false">
                                                        <ItemTemplate>
					                                        <asp:Image id="imgFlag" runat="server" ImageUrl='<%# DataBinder.Eval(Container, "DataItem.Depre_flag") %>'>
					                                        </asp:Image>
				                                        </ItemTemplate>
                                                        <HeaderStyle Font-Bold="False" Font-Italic="False" Font-Overline="False" 
                                                            Font-Strikeout="False" Font-Underline="False" HorizontalAlign="Center" 
                                                            Width="60px" Wrap="True" />
                                                        <ItemStyle Font-Bold="False" Font-Italic="False" Font-Overline="False" 
                                                            Font-Strikeout="False" Font-Underline="False" HorizontalAlign="Center" 
                                                            Wrap="True" />
                                                    </telerik:GridTemplateColumn>
                                                    <telerik:GridBoundColumn DataField="Depre_cal" 
                                                        HeaderStyle-HorizontalAlign="Center" UniqueName="Depre_cal" Visible="false">
                                                        <HeaderStyle HorizontalAlign="Center" />
                                                    </telerik:GridBoundColumn>
                                                    <telerik:GridBoundColumn DataField="Seq" 
                                                        HeaderStyle-HorizontalAlign="Center" UniqueName="Seq" 
                                                        Visible="false">
                                                        <HeaderStyle HorizontalAlign="Center" />
                                                    </telerik:GridBoundColumn>
                                                    <telerik:GridBoundColumn DataField="InfoRecord.InfoStatus.Status" 
                                                        HeaderStyle-HorizontalAlign="Center" UniqueName="InfoRecord.InfoStatus.Status" Visible="false">
                                                        <HeaderStyle HorizontalAlign="Center" />
                                                    </telerik:GridBoundColumn>
                                                </Columns>
                                            </MasterTableView>
                                            <ClientSettings EnableRowHoverStyle="true" >
                                                <Selecting AllowRowSelect="True" />
                                                <ClientEvents OnRowDblClick="RowDbClick" />
                                            </ClientSettings>
                                        </telerik:RadGrid>
                                    </div>
                                    <br />
                                </asp:Panel>
                            </div>
                        </div>
                    </asp:Panel>
                </td>
            </tr>
        </table>
    </form>
</body>
</html>
